﻿using System;
using Silent.WCF.Interfaces;

namespace Silent.WCF.Base.Common
{
    public class UriBuilder : IUriBuilder
    {
        public Uri GetAddress(string host, int port, string name = null)
        {
            return name == null
                ? new Uri(string.Format(@"net.tcp://{0}:{1}/{2}", host, port, "ProxyServer"))
                : new Uri(string.Format(@"net.tcp://{0}:{1}/{2}/{3}", host, port, "ProxyServer", name));
        }
    }
}